package search;

import java.util.ArrayList;

import model.type.SubjectType;


public class SearchString {
	private String name, country, county, city, address, zip, contact;
	private Integer type;
	private ArrayList<SearchAttribute> attributes = new ArrayList<SearchAttribute>();
	
	public SearchString(String name, String type, String country, String county, 
			String city, String address, String zip, String contact, ArrayList<SearchAttribute> attributes){
				
		try{
			this.type = Integer.parseInt(type);
		} catch(NumberFormatException | NullPointerException e){}		
		this.name = name.trim().isEmpty() ? null: name.trim();
		this.country = country.trim().isEmpty() ? null: country.trim();		
		this.county = county.trim().isEmpty() ? null: county.trim();
		this.city = city.trim().isEmpty() ? null: city.trim();
		this.address = address.trim().isEmpty() ? null: address.trim();
		this.zip = zip.trim().isEmpty() ? null: zip.trim();
		this.contact = contact.trim().isEmpty() ? null: contact.trim();
		this.attributes.addAll(attributes);		
	}
	
	public SearchString(){}
	
	public String getName() {
		return name;
	}

	public Integer getType() {
		return type;
	}
	
	public String getCountry() {
		return country;
	}

	public String getCounty() {
		return county;
	}

	public String getCity() {
		return city;
	}

	public String getAddress() {
		return address;
	}

	public String getZip() {
		return zip;
	}

	public String getContact() {
		return contact;
	}

	public ArrayList<SearchAttribute> getAttributes() {
		return attributes;
	}	
}
